<?php

namespace Mcm\RepasBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class RepasType extends AbstractType {

    protected $user;

    public function __construct(){
    }

    public function buildForm(FormBuilderInterface $builder, array $options) {
        $builder
                ->add('titre', 'text', array('label' => 'Thème'))
                ->add('date_repas','mybundle_type_datetime_picker',array('widget' => 'single_text', 'input' => 'datetime','attr' => array('class' => 'date'),'label' => 'Date du repas :'))
                ->add('nombre_place', 'number', array('label' => 'Nombre de places : '))
                ->add('prix')
                ->add('adresse', 'textarea', array('label' => 'Lieu de rendez-vous :'))
                ->add('menu', 'textarea')
                ->add('entree')
                ->add('plat')
                ->add('dessert')
                ;
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver) {
        $resolver->setDefaults(array(
            'data_class' => 'Mcm\RepasBundle\Entity\Repas'
        ));
    }

    public function getName() {
        return 'mcm_repasbundle_repastype';
    }

}
